<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8" />
    <title th:text="${channel.name}">怪咖晨</title>
    <meta name="keywords" th:content="|${channel.name},个人博客,怪咖晨,怪咖晨个人博客|" />
    <meta name="description" th:content="${ channel.attr !=null && channel.attr.containsKey('descript') ? channel.attr.descript : '怪咖晨，一个Java程序员的碎碎念。'}" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" type="text/css" th:href="@{/style/base.css}" />
    <link rel="stylesheet" type="text/css" th:href="@{/style/index.css}" />
    <link rel="stylesheet" type="text/css" href="//at.alicdn.com/t/font_623338_6w00nr2jkx2edn29.css"/>
</head>

<body>
    <header th:replace="common/header"></header>
    <article>
        <div class="leftbox">
            <div class="newblogs">
                <h2 class="hometitle">
                   <span th:text="${ channel.attr !=null && channel.attr.containsKey('descript') ? channel.attr.descript : ''}"></span>
                   <i th:text="${channel.name}"></i>
                </h2>
                <app:article rows="10" page="${currentPage}" sort="desc" sidx="releaseDate"  channelBid="${channel.bid}">
                <ul>
                    <li th:each="article : ${paging.rows}">
                        <h3 class="blogtitle">
                            <a th:href="@{|/${article.channel.path}/${article.bid}.html|}" target="_blank" th:text="${ (article.shortTitle != null && article.shortTitle != '') ? article.shortTitle : article.title}"></a>
                        </h3>
                        <div class="bloginfo">
                            <span class="blogpic">
                                <a th:href="@{|/${article.channel.path}/${article.bid}.html|}" th:title="${ (article.shortTitle != null && article.shortTitle != '') ? article.shortTitle : article.title}">
                                    <img th:src="@{/upload/53c4dd571beb7.jpg}" th:alt="${ (article.shortTitle != null && article.shortTitle != '') ? article.shortTitle : article.title}" />
                                </a>
                            </span>
                            <p th:utext="${#strings.abbreviate(article.summary,145)}">文章内容...</p>
                        </div>
                        <div class="autor">
                            <span class="lm f_l">
                               <a th:href="@{|/type/${article.articleType.code}.html|}" th:title"${article.articleType.name}" target="_blank" class="classname" th:text="${article.articleType.name}">文章类别</a>
                            </span>
                            <span class="dtime f_l" th:text="${ #dates.format(article.releaseDate,'yyyy-MM-dd') }">yyyy-MM-dd</span>
	                            <span class="viewnum f_l">浏览（<a href="javascript:void(0);" th:text="${article.accessNum}">0</a>）</span>
                            <span class="f_r">
                                <a th:href="@{|/${article.channel.path}/${article.bid}.html|}" class="more">阅读原文>></a>
                            </span>
                        </div>
                    </li>
                </ul>
                <div class="pagelist" th:with="pageSize=7,showPrevMore=${(paging.total > pageSize && paging.page > pageSize - 3)},showNextMore=${(paging.total > pageSize && paging.page < paging.total - 3)}">
                    <!-- <a title="总页数">
                        <b th:text="|${paging.total}|">200</b>
                    </a>&nbsp;&nbsp;&nbsp; -->
                    
                    <th:block th:if="${paging.total > 0}" >
                    	<b th:if="${ 1 == paging.page}" >1</b>
                    	<a th:if="${ 1 != paging.page}" th:href="@{|/${channel.path}.html|(page=1)}">1</a>&nbsp;
                    </th:block>
                    
                    <th:block th:if="${showPrevMore}">
                    	<a th:href="@{|/${channel.path}.html|(page=${paging.page-1})}"><span class="iconfont icon-more"></span></a>
                    </th:block>
                    
                    <th:block th:if="${showPrevMore && !showNextMore}" th:each="page : ${new String[5]}" th:with="startPage=${ paging.total - (pageSize-2)}" >
                    	<b th:if="${(pageStat.index + startPage) == paging.page}" th:text="${pageStat.index + startPage}"></b>
                    	<a th:if="${(pageStat.index + startPage) != paging.page}" th:text="${pageStat.index + startPage}" th:href="@{|/${channel.path}.html|(page=${(pageStat.index + startPage)})}"></a>&nbsp;
                    </th:block>
                    
                    
                    <th:block th:if="${showPrevMore && showNextMore}" th:each="page : ${new String[5]}" th:with="offset=${(pageSize / 2) - 1 },startPage=${paging.page - offset}" >
                    	<b th:if="${(pageStat.index+startPage) == paging.page}" th:text="${pageStat.index + startPage}"></b>
                    	<a th:if="${(pageStat.index+startPage) != paging.page}" th:text="${pageStat.index + startPage}" th:href="@{|/${channel.path}.html|(page=${(pageStat.index + startPage)})}"></a>&nbsp;
                    </th:block>
                    
                    <th:block th:if="${!showPrevMore && !showNextMore}" th:each="page : ${new String[(paging.total <= 2 ? 0 : paging.total - 2)]}">
                    	<b th:if="${(pageStat.index + 2) == paging.page}" th:text="${pageStat.index + 2}"></b>
                    	<a th:if="${(pageStat.index + 2) != paging.page}" th:text="${pageStat.index + 2}" th:href="@{|/${channel.path}.html|(page=${(pageStat.index + 2)})}"></a>&nbsp;
                    </th:block>
                    
                    <th:block th:if="${!showPrevMore && showNextMore}" th:each="page : ${new String[5]}">
                    	<b th:if="${(pageStat.index + 2) == paging.page}" th:text="${pageStat.index + 2}"></b>
                    	<a th:if="${(pageStat.index + 2) != paging.page}" th:text="${pageStat.index + 2}" th:href="@{|/${channel.path}.html|(page=${(pageStat.index + 2)})}"></a>&nbsp;
                    </th:block>
                    
                    <th:block th:if="${showNextMore}">
                    	<a th:href="@{|/${channel.path}.html|(page=${paging.page+1})}">
                    		<span class="iconfont icon-more"></span>
                    	</a>
                    </th:block>
                    
                    <th:block th:if="${ paging.total > 1}">
                    	<b th:if="${ paging.total == paging.page}" th:text="${paging.total}"></b>
                    	<a th:if="${ paging.total != paging.page}" th:text="${paging.total}" th:href="@{|/${channel.path}.html|(page=${paging.total})}"></a>&nbsp;
                    </th:block>
                </div>
                </app:article>
            </div>
        </div>
        <div class="rightbox">
            <div th:replace="common/rightbox :: .search"></div>
            <div class="paihang">
                <h2 class="ab_title">
                    <a href="/">本栏推荐</a>
                </h2>
                <ul>
                	<app:article rows="6" sort="desc" sidx="releaseDate"  channelBid="${channel.bid}" isRecommend="1">
               		<li th:each="article : ${paging.rows}">
                        <b>
                            <a th:href="@{|/${article.channel.path}/${article.bid}.html|}" target="_blank" th:text="${ #strings.abbreviate((article.shortTitle != null && article.shortTitle != '') ? article.shortTitle : article.title , 17)}">文章标题</a>
                        </b>
                        <p th:utext="${#strings.abbreviate(article.summary,72)}">文章内容...</p>
                    </li>
                	</app:article>
                </ul>
                <div class="ad">
                    <!-- <img src="picture/ad300x100.jpg"/> -->
                </div>
            </div>
            <div class="paihang">
                <h2 class="ab_title">
                    <a href="/">点击排行</a>
                </h2>
                <ul>
                    <app:article rows="6" page="1" sort="desc" sidx="accessNum" channelBid="${channel.bid}">
	                	<li th:each="article : ${paging.rows}">
	                        <b>
	                            <a th:href="@{|/${article.channel.path}/${article.bid}.html|}" target="_blank" th:text="${ #strings.abbreviate((article.shortTitle != null && article.shortTitle != '') ? article.shortTitle : article.title , 17)}">文章标题</a>
	                        </b>
	                        <p th:utext="${#strings.abbreviate(article.summary,72)}">文章内容...</p>
	                    </li>
                	</app:article>
                </ul>
                <div class="ad">
                    <!-- <img src="picture/ad01.jpg"/> -->
                </div>
            </div>
            <div th:replace="common/rightbox :: .weixin"></div>
        </div>
    </article>
    <footer th:replace="common/footer"></footer>
</body>

</html>
